import React, { Component } from "react";
import PropTyps from "prop-types";
import addWaterMark from "../../utils/addWaterMark.js";

class Card extends Component {
  
  constructor(props) {
    super(props);
  }

  componentDidMount() {
    addWaterMark();
  }

  render() {
    const { title, children, extra ,className = ""} = this.props;
    return (
      <div className={`preview-card waterMark ${className}`}>
        <div className="preview-card-title">
          {title} <span className="preview-card-extra">{extra}</span>
        </div>

        <div className="preview-card-form">{children}</div>
      </div>
    )
  }
}

Card.propTypes = {
  title: PropTyps.string,
  children: PropTyps.any,
  extra: PropTyps.string
};

Card.defaultProps = {
  title: "",
  extra: ""
};
export default Card;
